//
//  SelectorGroup.h
//  etionUI
//
//  Created by wangjian on 9/26/13.
//  Copyright (c) 2013 GuangZhouXuanWu. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface CSelectorItem : UIView
{
    UILabel *_titleLable;
    BOOL _selected;
}

@property (nonatomic, readonly) UILabel *titleLable;
@property (nonatomic, assign, getter = isSelected) BOOL selected;

- (id)initWithFrame:(CGRect)frame selectImage:(UIImage *)selectImage unselectImage:(UIImage *)unselectImage imageStartX:(float)startX;

@end

@class CSelectorGroup;

@protocol CSelectorGroupDelegate <NSObject>

- (void)selectorGroup:(CSelectorGroup *)selectorGroup itemAtIndex:(NSUInteger)index selectStateChanged:(BOOL)isSelected;

@end

@interface CSelectorGroup : UIView
{
    id<CSelectorGroupDelegate> _delegate;
    NSMutableArray *_arItems;
}

@property (nonatomic, assign) id<CSelectorGroupDelegate> delegate;

- (id)initWithTitles:(NSArray *)titles width:(float)width selectImage:(UIImage *)selectImage unselectImage:(UIImage *)unselectImage;
- (void)changeSelectStateAtIndex:(NSUInteger)index toState:(BOOL)isSelected;
- (NSIndexSet *)selectedIndexSet;

@end

@interface CSelectorGroupUnique : CSelectorGroup

- (NSUInteger)currentSelectedIndex;

@end

@interface CSelectorGroupMultiple : CSelectorGroup

@end
